package com.cainli.szbus.data.requestmanager;

import android.content.Context;

import com.cainli.szbus.data.service.SZBusRequestService;
import com.foxykeep.datadroid.requestmanager.RequestManager;
import com.foxykeep.datadroid.service.RequestService;
/**
 *  This class is used as a proxy to call the Service. It provides easy-to-use methods to call the
 *  service and manages the Intent creation. It also assures that a request will not be sent again if
 *  an exactly identical one is already in progress.
 * @author cainli
 *
 */
public final class SZBusRequestManager extends RequestManager {

    // Singleton management
    private static SZBusRequestManager sInstance;

    public synchronized static SZBusRequestManager from(Context context) {
        if (sInstance == null) {
            sInstance = new SZBusRequestManager(context);
        }

        return sInstance;
    }

    private SZBusRequestManager(Context context) {
        super(context, SZBusRequestService.class);
    }
}
